Mkup.zen = function(targetElement){
	var mkup;
	
	function Zen(){
		mkup = Mkup.mkup(targetElement);

		this.write = function(zenExpression){
			parseCommands(zenExpression);
			mkup.write();
		};
		
		function parseCommands(zenExpression){
			var tagDefsChild = zenExpression.split(">");
			tagDefsChild.each(function(tagDefChild){
				mkup.child();
				runCommand(tagDefChild.split("+"));
			});
		}
		
		function runCommand(tagDefs){
			tagDefs.each(function(tagDef){
				var pattern = /^([\.|#|\*|\[])([^\.|^#|^*|^\[]*)$/g,
					tag, 
					isText=false,
					attributes = {className:[]}, 
					repeat = 1;
				//console.log("Tagdef="+tagDef);
				tag = /^([^\.|^#|^\*|^\[]*)/.exec(tagDef)[1];
				if(tag[0]=="'" || tag[0] == '"'){
					isText = true;
					tag = tag.replace(/'|"/g,"");
				}
				//console.log("\tTag="+tag);
				while((result = pattern.exec(tagDef))!=null){
					//console.log("\tresult="+result);
					if(result[1] == '#'){
						attributes.id=result[2];
					}else if(result[1] == "*"){
						repeat = parseInt(result[2],10);
					}else if(result[1] == "["){
						attributesDef = result[0].substring(1,result[0].length-1);
						attributesDef.split(",").each(function(singleAttribute){
							var keyValue = singleAttribute.split("=");
							attributes[keyValue[0]] = keyValue[1].replace(/'/g,"");
						});
						//console.log(attributesDef);
					}else{
						attributes.className.push(result[2]);
					}
				}
				if(attributes.className.length > 0){
					attributes.className = attributes.className.join(" ");
				}else{
					delete attributes.className;
				}
				//console.dir(attributes);
				repeat.times(function(idx){
					var replacedAtts={};
					if(isText){
						mkup.text((tag.replace(/"|'/g,'')).replace(/\$/g,idx));
					}else{
						for(prop in attributes){
							replacedAtts[prop] = attributes[prop].replace("$",idx);
						}
						mkup[tag](replacedAtts);
					}
				});
			});
		}
	}
	return new Zen();
};